package cn.itcast.myapplication.base;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.itcast.myapplication.R;

public class BaseActivity extends FragmentActivity {

    public String TAG = getClass().getSimpleName();

    Unbinder binder;

    // 系统的Density
    private static float sNoncompatDensity;


    // 系统的ScaledDensity
    private static float sNoncompatScaledDensity;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏

        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏

        setContentView(getLayoutID());

        this.binder = ButterKnife.bind((Activity) this);

        initView();

        init();

    }

    public void init() {

    }

    public void initView() {

    }

    public int getLayoutID() {

        return R.layout.activity_main;

    }

    public void onDestroy() {

        super.onDestroy();

        this.binder.unbind();

    }

}